Rem 运行此代码请先勾选上MathType库
Sub mathtypeEqToLatex()
    Dim fd As Field
    Dim fw As Range
    Dim i As Long
    
    t0 = Now
    Set fw = Selection.Range
    If fw.Start = fw.End Then Exit Sub
    Application.ScreenUpdating = False
    
    For Each fd In fw.Fields
        If fd.Code Like "*EMBED Equation.*" Then
            fd.Select
            MathTypeCommands.MTCommand_TeXToggle
            i = i + 1
        End If
    Next
    
    fw.Select
    Application.ScreenUpdating = True
    Set fw = Nothing
    Set fd = Nothing
    Debug.Print DateDiff("s", t0, Now)
    MsgBox Format(i, "完成 共处理了0个公式")
End Sub